﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_XuatKho : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvBoPhan")]
        private ADVList _AdvBoPhan;
        [AccessedThroughProperty("AdvHopDong")]
        private ADVList _AdvHopDong;
        [AccessedThroughProperty("AdvSanPham")]
        private ADVList _AdvSanPham;
        [AccessedThroughProperty("AdvTaiKhoanChu")]
        private ADVAccount _AdvTaiKhoanChu;
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTab2")]
        private C1DockingTab _C1DockingTab2;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("CboKhoanMucChiPhi")]
        private ComboBox _CboKhoanMucChiPhi;
        [AccessedThroughProperty("CboLoaiDuLieu")]
        private ComboBox _CboLoaiDuLieu;
        [AccessedThroughProperty("CboLoaiNhapXuat")]
        private ComboBox _CboLoaiNhapXuat;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CKHienThiSeri")]
        private CheckBox _CKHienThiSeri;
        [AccessedThroughProperty("CKSoSeri")]
        private CheckBox _CKSoSeri;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdBoGhiSo")]
        private ToolStripButton _CmdBoGhiSo;
        [AccessedThroughProperty("CmdChuyen")]
        private Button _CmdChuyen;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdGhiSo")]
        private ToolStripButton _CmdGhiSo;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdSearchHangHoa")]
        private Button _CmdSearchHangHoa;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("ImageList1")]
        private ImageList _ImageList1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label10")]
        private Label _Label10;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label12")]
        private Label _Label12;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label25")]
        private Label _Label25;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label8")]
        private Label _Label8;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("PNDungChung")]
        private Panel _PNDungChung;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripButton2")]
        private ToolStripButton _ToolStripButton2;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtBarCode")]
        private TextBox _TxtBarCode;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNguoiNhan")]
        private TextBox _TxtNguoiNhan;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoLuong")]
        private C1NumericEdit _TxtSoLuong;
        [AccessedThroughProperty("TxtTienHang")]
        private C1NumericEdit _TxtTienHang;
        [AccessedThroughProperty("TxtTienHangNT")]
        private C1NumericEdit _TxtTienHangNT;
        [AccessedThroughProperty("txtTyGia")]
        private C1NumericEdit _txtTyGia;
        [AccessedThroughProperty("VSHangHoa")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSHangHoa;
        private string cFrmFormat;
        private int cFrmGhiSo;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        public string mKhoaKiemKe;
        private string mLoaiChungTu;
        private clsDMDonViTinh objDVT;
        private clsDMHangHoa objHH;
        private clsSoChungTu objSoCT;
        private clsXuatKho objXK;
        private clsHoaDonChiTietDichVu objXKDV;
        private clsXuatKhoChiTiet objXKHH;
        private DataTable pdt;

        public Frm_XuatKho()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_XuatBan_KeyDown);
            base.Load += new EventHandler(this.Frm_XuatBan_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "XKHH";
            this.objSoCT = new clsSoChungTu();
            this.mKhoaKiemKe = "";
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.objHH = new clsDMHangHoa();
            this.objDVT = new clsDMDonViTinh();
            this.objXK = new clsXuatKho();
            this.objXKHH = new clsXuatKhoChiTiet();
            this.objXKDV = new clsHoaDonChiTietDichVu();
            this.cFrmGhiSo = 0;
            this.cFrmTask = "";
            this.InitializeComponent();
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                this.txtTyGia.Value = 0;
            }
            else
            {
                string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                if (strCode != "")
                {
                    clsDMLoaiTien tien = new clsDMLoaiTien();
                    tien.LoadByCode(strCode);
                    if (tien.SoLe > 0)
                    {
                        this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("##########", tien.SoLe);
                    }
                    if (tien.TienViet == 1)
                    {
                        this.txtTyGia.Enabled = false;
                    }
                    this.txtTyGia.Value = tien.TyGia;
                    this.FormatNumber();
                }
            }
        }

        public bool CheckGrid()
        {
            if (this.VSHangHoa.Rows.Count == 1)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập h\x00e0ng h\x00f3a, dịch vụ cần b\x00e1n!", ""));
                this.CmdAddRow.Focus();
                return false;
            }
            return true;
        }

        public bool CheckIvalid()
        {
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objXK.IsDuplicateVoucherNo(this.TxtSoChungTu.Text, this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn h\x00e3y nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            if (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing)) == 0.0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập tỷ gi\x00e1 nguy\x00ean tệ!", ""));
                this.txtTyGia.Focus();
                return false;
            }
            if (modGeneral.H_GHISODONGTHOI && (LVYModule.ReturnIfNull(this.AdvTaiKhoanChu.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == ""))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số t\x00e0i khoản nợ!", ""));
                this.AdvTaiKhoanChu.Focus();
                return false;
            }
            if (!this.CheckGrid())
            {
                return false;
            }
            return true;
        }

        private void CKHienThiSeri_CheckedChanged(object sender, EventArgs e)
        {
            if (this.CKHienThiSeri.CheckState == CheckState.Checked)
            {
                this.VSHangHoa.Cols[7].Visible = true;
                this.VSHangHoa.Cols[5].Width -= this.VSHangHoa.Cols[7].Width;
            }
            else
            {
                this.VSHangHoa.Cols[7].Visible = false;
                this.VSHangHoa.Cols[5].Width += this.VSHangHoa.Cols[7].Width;
            }
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("ST_XuatKho", 15, "XK");
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
            this.CboLoaiTien.SelectedValue = modGeneral.H_CURRENCY;
            this.EnabledControl = true;
            this.TxtSoChungTu.Focus();
            this.InitDefault();
            this.cFrmTask = "I";
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
            }
            else
            {
                int num2 = 0;
                if (this.VSHangHoa.Rows.Count > 1)
                {
                    num2 = this.VSHangHoa.Rows.Count - 1;
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[num2, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        return;
                    }
                }
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                vSHangHoa.AddItem("");
                vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = 0;
                vSHangHoa[vSHangHoa.Rows.Count - 1, 14] = 0;
                vSHangHoa[vSHangHoa.Rows.Count - 1, 15] = 0;
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = 0;
                vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = 0;
                if ((this.VSHangHoa.Rows.Count == 2) && (LVYModule.ReturnIfNull(modGeneral.H_STOCKID, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != ""))
                {
                    clsDMKho kho = new clsDMKho();
                    kho.Load(modGeneral.H_STOCKID);
                    this.VSHangHoa[this.VSHangHoa.Rows.Count - 1, 1] = kho.Khoa;
                    this.VSHangHoa[this.VSHangHoa.Rows.Count - 1, 2] = kho.Ma;
                }
                if (vSHangHoa.Rows.Count >= 2)
                {
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(vSHangHoa[1, 1]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(vSHangHoa[1, 2]);
                }
                vSHangHoa.Select(this.VSHangHoa.Rows.Count - 1, 2);
                vSHangHoa.Focus();
                vSHangHoa = null;
            }
        }

        private void CmdBoGhiSo_Click(object sender, EventArgs e)
        {
            if (this.objXK.UnRegistered(this.cFrmKhoa))
            {
                this.CmdGhiSo.Visible = true;
                this.CmdBoGhiSo.Visible = false;
                this.CmdEdit.Enabled = this.mAllowEdit;
                this.CmdDel.Enabled = this.mAllowDel;
            }
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (((LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "") && LVYModule.ConfirmDelete("")) && this.objXK.DeleteData(this.cFrmKhoa, 1))
            {
                this.EmptyData();
                this.EnabledControl = false;
            }
        }

        private void CmdDelRow_Click(object sender, EventArgs e)
        {
            if (this.VSHangHoa.Rows.Count != 1)
            {
                this.VSHangHoa.RemoveItem(this.VSHangHoa.Row);
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)) && (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != ""))
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
                this.cFrmTask = "U";
                this.EnabledControl = true;
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_XuatKhoList.Show();
            MyProject.Forms.Frm_XuatKhoList.BringToFront();
        }

        private void CmdGhiSo_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                MyProject.Forms.Frm_GhiSoXuatKho.cFrmKhoa = this.cFrmKhoa;
                MyProject.Forms.Frm_GhiSoXuatKho.ShowDialog();
                if (MyProject.Forms.Frm_GhiSoXuatKho.GhiSo)
                {
                    this.CmdGhiSo.Visible = false;
                    this.CmdBoGhiSo.Visible = true;
                    this.CmdEdit.Enabled = false;
                    this.CmdDel.Enabled = false;
                }
                else
                {
                    this.CmdGhiSo.Visible = true;
                    this.CmdBoGhiSo.Visible = false;
                    this.CmdEdit.Enabled = true;
                    this.CmdDel.Enabled = true;
                }
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintXuatKhoHang(this.cFrmKhoa);
            }
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveHHDetailsTemp())
                {
                    this.objXK.ClearTemp(this.cFrmKhoa);
                }
                else if (Conversions.ToBoolean(Microsoft.VisualBasic.CompilerServices.Operators.NotObject(this.UpdateData())))
                {
                    this.objXK.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objXK.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                    this.cFrmTask = "";
                }
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoaOld, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
            }
            if (this.cFrmTask == "I")
            {
                this.objSoCT.UndoVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
            }
            this.cFrmTask = "";
            this.EnabledControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtSoChungTu.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.CboLoaiTien.SelectedValue = "";
            this.txtTyGia.Value = 0;
            this.TxtDienGiai.Text = "";
            this.AdvTaiKhoanChu.Value = "";
            this.VSHangHoa.Rows.Count = 1;
            this.TxtTienHang.Value = 0;
            this.TxtTienHangNT.Value = 0;
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.txtTyGia, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienHangNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienHang, modGeneral.H_FORMATNUMBER);
        }

        private void Frm_XuatBan_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode != Keys.ControlKey)
            {
                if (keyCode == Keys.Escape)
                {
                    if (this.CmdExit.Enabled)
                    {
                        this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F2)
                {
                    if (this.CmdEdit.Enabled)
                    {
                        this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F3)
                {
                    this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
                else if (keyCode == Keys.F8)
                {
                    if (this.CmdAdd.Enabled)
                    {
                        this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F9)
                {
                    if (this.CmdDel.Enabled)
                    {
                        this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F10)
                {
                    if (this.CmdSave.Enabled)
                    {
                        this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if (keyCode == Keys.F11)
                {
                    if (this.CmdUnsave.Enabled)
                    {
                        this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                    }
                }
                else if ((keyCode == Keys.F12) && this.CmdPrint.Enabled)
                {
                    this.CmdPrint_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
        }

        private void Frm_XuatBan_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnabledControl = false;
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                vSHangHoa.Cols[1].DataMap = LVYModule.MapDataDanhMuc(modGeneral.ListDanhMuc.KhoHang);
                vSHangHoa.Cols[6].Visible = modGeneral.H_THEODOISOLOHANG;
                vSHangHoa.Cols[7].Visible = modGeneral.H_THEODOISERI;
                vSHangHoa.Cols[9].Visible = modGeneral.H_THEODOIHANDUNG;
                vSHangHoa.Cols[13].Editor = this.TxtSoLuong;
                vSHangHoa = null;
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                BuildComboModule.BuildCombo(this.CboLoaiNhapXuat, modGeneral.ListDanhMuc.LoaiNhapXuat, false, " Loai = 'XK'", "");
                BuildComboModule.BuildCombo(this.CboKhoanMucChiPhi, modGeneral.ListDanhMuc.KhoanMucChiPhi, true, "", "");
                BuildComboModule.InitComboDatatype(this.CboLoaiDuLieu);
                this.PNDungChung.Visible = modGeneral.H_KETHOPDULIEUTHUE;
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.EmptyData();
                }
                else
                {
                    this.ShowData(this.cFrmKhoa);
                }
                this.Cursor = Cursors.Default;
            }
        }

        public void InitDefault()
        {
            this.AdvTaiKhoanChu.Value = LVYModule.ReturnIfNull(modGeneral.H_DEFAULT.Item("H_XK_TKCHU").GiaTri, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_XuatKho));
            this.TxtNguoiNhan = new TextBox();
            this.Label12 = new Label();
            this.CboKhoanMucChiPhi = new ComboBox();
            this.Label4 = new Label();
            this.CboLoaiNhapXuat = new ComboBox();
            this.Label3 = new Label();
            this.AdvHopDong = new ADVList();
            this.AdvSanPham = new ADVList();
            this.AdvBoPhan = new ADVList();
            this.Label8 = new Label();
            this.Label7 = new Label();
            this.Label6 = new Label();
            this.Label2 = new Label();
            this.AdvTaiKhoanChu = new ADVAccount();
            this.TxtDienGiai = new TextBox();
            this.Label9 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.txtTyGia = new C1NumericEdit();
            this.Label11 = new Label();
            this.Label10 = new Label();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.ImageList1 = new ImageList(this.components);
            this.CmdSearchHangHoa = new Button();
            this.CKSoSeri = new CheckBox();
            this.CmdDelRow = new Button();
            this.TxtBarCode = new TextBox();
            this.Label25 = new Label();
            this.CmdDel = new ToolStripButton();
            this.CmdExit = new ToolStripButton();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripButton();
            this.Panel4 = new Panel();
            this.TxtSoLuong = new C1NumericEdit();
            this.CKHienThiSeri = new CheckBox();
            this.CmdAddRow = new Button();
            this.Panel5 = new Panel();
            this.TxtTienHangNT = new C1NumericEdit();
            this.TxtTienHang = new C1NumericEdit();
            this.Label5 = new Label();
            this.ToolStripButton2 = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.CmdSave = new ToolStripButton();
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdGhiSo = new ToolStripButton();
            this.CmdBoGhiSo = new ToolStripButton();
            this.VSHangHoa = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.PNDungChung = new Panel();
            this.CmdChuyen = new Button();
            this.CboLoaiDuLieu = new ComboBox();
            this.C1DockingTab1 = new C1DockingTab();
            this.C1DockingTabPage1 = new C1DockingTabPage();
            this.C1DockingTab2 = new C1DockingTab();
            this.C1DockingTabPage2 = new C1DockingTabPage();
            ((ISupportInitialize) this.txtTyGia).BeginInit();
            this.Panel4.SuspendLayout();
            ((ISupportInitialize) this.TxtSoLuong).BeginInit();
            this.Panel5.SuspendLayout();
            ((ISupportInitialize) this.TxtTienHangNT).BeginInit();
            ((ISupportInitialize) this.TxtTienHang).BeginInit();
            this.ToolStrip1.SuspendLayout();
            this.VSHangHoa.BeginInit();
            this.PNDungChung.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab1).BeginInit();
            this.C1DockingTab1.SuspendLayout();
            this.C1DockingTabPage1.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab2).BeginInit();
            this.C1DockingTab2.SuspendLayout();
            this.C1DockingTabPage2.SuspendLayout();
            this.SuspendLayout();
            Point point = new Point(0x7d, 0x6a);
            this.TxtNguoiNhan.Location = point;
            this.TxtNguoiNhan.Name = "TxtNguoiNhan";
            Size size = new Size(0x124, 20);
            this.TxtNguoiNhan.Size = size;
            this.TxtNguoiNhan.TabIndex = 7;
            this.Label12.AutoEllipsis = true;
            this.Label12.AutoSize = true;
            this.Label12.BackColor = Color.Transparent;
            point = new Point(0x25, 0x6d);
            this.Label12.Location = point;
            this.Label12.Name = "Label12";
            this.Label12.RightToLeft = RightToLeft.No;
            size = new Size(0x59, 13);
            this.Label12.Size = size;
            this.Label12.TabIndex = 140;
            this.Label12.Text = "Người nhận h\x00e0ng";
            this.Label12.TextAlign = ContentAlignment.TopRight;
            this.CboKhoanMucChiPhi.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboKhoanMucChiPhi.FormattingEnabled = true;
            point = new Point(0x7d, 0x52);
            this.CboKhoanMucChiPhi.Location = point;
            this.CboKhoanMucChiPhi.Name = "CboKhoanMucChiPhi";
            size = new Size(0x124, 0x15);
            this.CboKhoanMucChiPhi.Size = size;
            this.CboKhoanMucChiPhi.TabIndex = 6;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new Point(0x1af, 0x10);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(50, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 0x8a;
            this.Label4.Text = "Loại xuất";
            this.CboLoaiNhapXuat.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiNhapXuat.FormattingEnabled = true;
            point = new Point(510, 12);
            this.CboLoaiNhapXuat.Location = point;
            this.CboLoaiNhapXuat.Name = "CboLoaiNhapXuat";
            size = new Size(0x120, 0x15);
            this.CboLoaiNhapXuat.Size = size;
            this.CboLoaiNhapXuat.TabIndex = 8;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new Point(0x23, 0x56);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x3d, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x88;
            this.Label3.Text = "Khoản mục";
            this.AdvHopDong.LoaiDanhMuc = ADVList.ListDanhMuc.HopDong;
            point = new Point(510, 0x52);
            this.AdvHopDong.Location = point;
            this.AdvHopDong.Name = "AdvHopDong";
            this.AdvHopDong.ReadOnly = false;
            size = new Size(0x120, 20);
            this.AdvHopDong.Size = size;
            this.AdvHopDong.TabIndex = 11;
            this.AdvHopDong.UpperText = true;
            this.AdvHopDong.Value = "";
            this.AdvHopDong.WidthCode = 80;
            this.AdvSanPham.LoaiDanhMuc = ADVList.ListDanhMuc.SanPham;
            point = new Point(510, 0x3b);
            this.AdvSanPham.Location = point;
            this.AdvSanPham.Name = "AdvSanPham";
            this.AdvSanPham.ReadOnly = false;
            size = new Size(0x120, 20);
            this.AdvSanPham.Size = size;
            this.AdvSanPham.TabIndex = 10;
            this.AdvSanPham.UpperText = true;
            this.AdvSanPham.Value = "";
            this.AdvSanPham.WidthCode = 80;
            this.AdvBoPhan.LoaiDanhMuc = ADVList.ListDanhMuc.BoPhan;
            point = new Point(510, 0x24);
            this.AdvBoPhan.Location = point;
            this.AdvBoPhan.Name = "AdvBoPhan";
            this.AdvBoPhan.ReadOnly = false;
            size = new Size(0x120, 20);
            this.AdvBoPhan.Size = size;
            this.AdvBoPhan.TabIndex = 9;
            this.AdvBoPhan.UpperText = true;
            this.AdvBoPhan.Value = "";
            this.AdvBoPhan.WidthCode = 80;
            this.Label8.AutoSize = true;
            this.Label8.BackColor = Color.Transparent;
            point = new Point(0x1af, 0x56);
            this.Label8.Location = point;
            this.Label8.Name = "Label8";
            size = new Size(0x37, 13);
            this.Label8.Size = size;
            this.Label8.TabIndex = 0x86;
            this.Label8.Text = "Hợp đồng";
            this.Label7.AutoSize = true;
            this.Label7.BackColor = Color.Transparent;
            point = new Point(0x1af, 0x3f);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x37, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 0x85;
            this.Label7.Text = "Sản phẩm";
            this.Label6.AutoSize = true;
            this.Label6.BackColor = Color.Transparent;
            point = new Point(0x1af, 0x27);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x2f, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0x84;
            this.Label6.Text = "Bộ phận";
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(0x21, 0x40);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(70, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x80;
            this.Label2.Text = "T\x00e0i khoản nợ";
            this.AdvTaiKhoanChu.Conditions = "";
            this.AdvTaiKhoanChu.DefaultValue = "";
            this.AdvTaiKhoanChu.FieldNameFilter = "";
            this.AdvTaiKhoanChu.KeyFilter = "";
            point = new Point(0x7d, 60);
            this.AdvTaiKhoanChu.Location = point;
            Padding padding = new Padding(0);
            this.AdvTaiKhoanChu.Margin = padding;
            this.AdvTaiKhoanChu.Name = "AdvTaiKhoanChu";
            this.AdvTaiKhoanChu.OnlyDigit = false;
            this.AdvTaiKhoanChu.ReadOnly = false;
            size = new Size(0x124, 20);
            this.AdvTaiKhoanChu.Size = size;
            this.AdvTaiKhoanChu.TabIndex = 5;
            this.AdvTaiKhoanChu.UpperText = true;
            this.AdvTaiKhoanChu.Value = "";
            this.AdvTaiKhoanChu.WithCode = 80;
            point = new Point(510, 0x6a);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x120, 20);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 12;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            this.Label9.BackColor = Color.Transparent;
            point = new Point(0x1af, 0x6d);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x30, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x11;
            this.Label9.Text = "Diễn giải";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiTien.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x7d, 0x24);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0x6c, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 3;
            this.txtTyGia.BorderStyle = BorderStyle.FixedSingle;
            this.txtTyGia.DataType = typeof(double);
            this.txtTyGia.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x13c, 0x24);
            this.txtTyGia.Location = point;
            this.txtTyGia.Name = "txtTyGia";
            padding = new Padding(1);
            this.txtTyGia.Padding = padding;
            size = new Size(0x65, 20);
            this.txtTyGia.Size = size;
            this.txtTyGia.TabIndex = 4;
            this.txtTyGia.Tag = null;
            this.txtTyGia.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.txtTyGia.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.txtTyGia.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label11.AutoSize = true;
            this.Label11.BackColor = Color.Transparent;
            point = new Point(0x21, 0x27);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 4;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label10.AutoSize = true;
            this.Label10.BackColor = Color.Transparent;
            point = new Point(0xef, 0x27);
            this.Label10.Location = point;
            this.Label10.Name = "Label10";
            size = new Size(0x24, 13);
            this.Label10.Size = size;
            this.Label10.TabIndex = 6;
            this.Label10.Text = "Tỷ gi\x00e1";
            this.Label10.TextAlign = ContentAlignment.TopRight;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new Point(0xef, 0x10);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 2;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Custom;
            point = new Point(0x13c, 13);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x65, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 2;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(0x21, 0x10);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 0;
            this.Label1.Text = "Số chứng từ";
            point = new Point(0x7d, 13);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x6c, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 1;
            this.ImageList1.ImageStream = (ImageListStreamer) manager.GetObject("ImageList1.ImageStream");
            this.ImageList1.TransparentColor = Color.Transparent;
            this.ImageList1.Images.SetKeyName(0, "orders_main.png");
            this.ImageList1.Images.SetKeyName(1, "checkingacct.png");
            this.ImageList1.Images.SetKeyName(2, "billing.png");
            this.CmdSearchHangHoa.FlatStyle = FlatStyle.System;
            point = new Point(0x182, 0x2e);
            this.CmdSearchHangHoa.Location = point;
            this.CmdSearchHangHoa.Name = "CmdSearchHangHoa";
            size = new Size(0x16, 0x16);
            this.CmdSearchHangHoa.Size = size;
            this.CmdSearchHangHoa.TabIndex = 0x25;
            this.CmdSearchHangHoa.Text = "...";
            this.CmdSearchHangHoa.UseVisualStyleBackColor = true;
            this.CKSoSeri.AutoSize = true;
            point = new Point(0x19d, 0x41);
            this.CKSoSeri.Location = point;
            this.CKSoSeri.Name = "CKSoSeri";
            size = new Size(0x3a, 0x11);
            this.CKSoSeri.Size = size;
            this.CKSoSeri.TabIndex = 0x24;
            this.CKSoSeri.Text = "Số se&ri";
            this.CKSoSeri.UseVisualStyleBackColor = true;
            this.CmdDelRow.Image = (Image) manager.GetObject("CmdDelRow.Image");
            this.CmdDelRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x62, 3);
            this.CmdDelRow.Location = point;
            this.CmdDelRow.Name = "CmdDelRow";
            size = new Size(90, 0x18);
            this.CmdDelRow.Size = size;
            this.CmdDelRow.TabIndex = 1;
            this.CmdDelRow.Text = "&2.X\x00f3a d\x00f2ng";
            this.CmdDelRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdDelRow.UseVisualStyleBackColor = true;
            point = new Point(250, 0x2f);
            this.TxtBarCode.Location = point;
            this.TxtBarCode.Name = "TxtBarCode";
            size = new Size(0x87, 20);
            this.TxtBarCode.Size = size;
            this.TxtBarCode.TabIndex = 0x24;
            this.Label25.AutoSize = true;
            point = new Point(0xc3, 50);
            this.Label25.Location = point;
            this.Label25.Name = "Label25";
            size = new Size(0x2f, 13);
            this.Label25.Size = size;
            this.Label25.TabIndex = 0x23;
            this.Label25.Text = "&Barcode";
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2d, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x37, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x43, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x25, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.Panel4.BackgroundImage = (Image) manager.GetObject("Panel4.BackgroundImage");
            this.Panel4.Controls.Add(this.TxtSoLuong);
            this.Panel4.Controls.Add(this.CKHienThiSeri);
            this.Panel4.Controls.Add(this.CmdSearchHangHoa);
            this.Panel4.Controls.Add(this.CKSoSeri);
            this.Panel4.Controls.Add(this.Label25);
            this.Panel4.Controls.Add(this.TxtBarCode);
            this.Panel4.Controls.Add(this.CmdDelRow);
            this.Panel4.Controls.Add(this.CmdAddRow);
            this.Panel4.Controls.Add(this.Panel5);
            this.Panel4.Dock = DockStyle.Bottom;
            point = new Point(0, 0x219);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x37c, 30);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 1;
            this.TxtSoLuong.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoLuong.DataType = typeof(double);
            this.TxtSoLuong.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x194, 0x2f);
            this.TxtSoLuong.Location = point;
            this.TxtSoLuong.Name = "TxtSoLuong";
            padding = new Padding(1);
            this.TxtSoLuong.Padding = padding;
            size = new Size(0x55, 20);
            this.TxtSoLuong.Size = size;
            this.TxtSoLuong.TabIndex = 0xa4;
            this.TxtSoLuong.Tag = null;
            this.TxtSoLuong.TextAlign = HorizontalAlignment.Right;
            this.TxtSoLuong.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.TxtSoLuong.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoLuong.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.CKHienThiSeri.AutoSize = true;
            this.CKHienThiSeri.Checked = true;
            this.CKHienThiSeri.CheckState = CheckState.Checked;
            point = new Point(5, 0x35);
            this.CKHienThiSeri.Location = point;
            this.CKHienThiSeri.Name = "CKHienThiSeri";
            size = new Size(0x5f, 0x11);
            this.CKHienThiSeri.Size = size;
            this.CKHienThiSeri.TabIndex = 0x26;
            this.CKHienThiSeri.Text = "Hiển thị số seri";
            this.CKHienThiSeri.UseVisualStyleBackColor = true;
            this.CmdAddRow.Image = (Image) manager.GetObject("CmdAddRow.Image");
            this.CmdAddRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(3, 3);
            this.CmdAddRow.Location = point;
            this.CmdAddRow.Name = "CmdAddRow";
            size = new Size(0x5d, 0x18);
            this.CmdAddRow.Size = size;
            this.CmdAddRow.TabIndex = 0;
            this.CmdAddRow.Text = "&1.Th\x00eam d\x00f2ng";
            this.CmdAddRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdAddRow.UseVisualStyleBackColor = true;
            this.Panel5.BackgroundImage = (Image) manager.GetObject("Panel5.BackgroundImage");
            this.Panel5.Controls.Add(this.TxtTienHangNT);
            this.Panel5.Controls.Add(this.TxtTienHang);
            this.Panel5.Controls.Add(this.Label5);
            this.Panel5.Dock = DockStyle.Right;
            point = new Point(0x249, 0);
            this.Panel5.Location = point;
            this.Panel5.Name = "Panel5";
            size = new Size(0x133, 30);
            this.Panel5.Size = size;
            this.Panel5.TabIndex = 0;
            this.TxtTienHangNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHangNT.DataType = typeof(double);
            this.TxtTienHangNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x59, 4);
            this.TxtTienHangNT.Location = point;
            this.TxtTienHangNT.Name = "TxtTienHangNT";
            padding = new Padding(1);
            this.TxtTienHangNT.Padding = padding;
            this.TxtTienHangNT.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTienHangNT.Size = size;
            this.TxtTienHangNT.TabIndex = 0x85;
            this.TxtTienHangNT.Tag = null;
            this.TxtTienHangNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHangNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienHangNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHangNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHang.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHang.DataType = typeof(double);
            this.TxtTienHang.FormatType = FormatTypeEnum.Currency;
            point = new Point(0xc5, 4);
            this.TxtTienHang.Location = point;
            this.TxtTienHang.Name = "TxtTienHang";
            padding = new Padding(1);
            this.TxtTienHang.Padding = padding;
            this.TxtTienHang.ReadOnly = true;
            size = new Size(0x69, 20);
            this.TxtTienHang.Size = size;
            this.TxtTienHang.TabIndex = 130;
            this.TxtTienHang.Tag = null;
            this.TxtTienHang.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHang.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienHang.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHang.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label5.AutoSize = true;
            this.Label5.BackColor = Color.Transparent;
            point = new Point(4, 7);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x37, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0x73;
            this.Label5.Text = "Tiền h\x00e0ng";
            this.ToolStripButton2.Alignment = ToolStripItemAlignment.Right;
            this.ToolStripButton2.Image = (Image) manager.GetObject("ToolStripButton2.Image");
            this.ToolStripButton2.ImageScaling = ToolStripItemImageScaling.None;
            this.ToolStripButton2.ImageTransparentColor = Color.White;
            this.ToolStripButton2.Name = "ToolStripButton2";
            size = new Size(0x31, 0x16);
            this.ToolStripButton2.Size = size;
            this.ToolStripButton2.Text = "&Help";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x37, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2d, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.ToolStripButton2, this.CmdGhiSo, this.CmdBoGhiSo });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x37c, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0x19;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x48, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdGhiSo.Image = (Image) manager.GetObject("CmdGhiSo.Image");
            this.CmdGhiSo.ImageTransparentColor = Color.White;
            this.CmdGhiSo.Name = "CmdGhiSo";
            size = new Size(0x38, 0x16);
            this.CmdGhiSo.Size = size;
            this.CmdGhiSo.Text = "&Ghi sổ";
            this.CmdGhiSo.Visible = false;
            this.CmdBoGhiSo.Image = (Image) manager.GetObject("CmdBoGhiSo.Image");
            this.CmdBoGhiSo.ImageTransparentColor = Color.Magenta;
            this.CmdBoGhiSo.Name = "CmdBoGhiSo";
            size = new Size(0x4d, 0x16);
            this.CmdBoGhiSo.Size = size;
            this.CmdBoGhiSo.Text = "Huỷ ghi sổ";
            this.CmdBoGhiSo.Visible = false;
            this.VSHangHoa.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.Light3D;
            this.VSHangHoa.ColumnInfo = manager.GetString("VSHangHoa.ColumnInfo");
            this.VSHangHoa.Dock = DockStyle.Fill;
            this.VSHangHoa.ExtendLastCol = true;
            this.VSHangHoa.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0);
            this.VSHangHoa.Location = point;
            padding = new Padding(0);
            this.VSHangHoa.Margin = padding;
            this.VSHangHoa.Name = "VSHangHoa";
            this.VSHangHoa.Rows.Count = 1;
            this.VSHangHoa.Rows.DefaultSize = 0x11;
            this.VSHangHoa.Rows.MaxSize = 20;
            this.VSHangHoa.Rows.MinSize = 20;
            size = new Size(890, 0x13b);
            this.VSHangHoa.Size = size;
            this.VSHangHoa.StyleInfo = manager.GetString("VSHangHoa.StyleInfo");
            this.VSHangHoa.TabIndex = 0x10;
            this.VSHangHoa.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.PNDungChung.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.PNDungChung.Controls.Add(this.CmdChuyen);
            this.PNDungChung.Controls.Add(this.CboLoaiDuLieu);
            point = new Point(0x261, 0x19);
            this.PNDungChung.Location = point;
            this.PNDungChung.Name = "PNDungChung";
            size = new Size(0x117, 0x17);
            this.PNDungChung.Size = size;
            this.PNDungChung.TabIndex = 0x1d;
            this.PNDungChung.Visible = false;
            this.CmdChuyen.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            point = new Point(0xfd, 0);
            this.CmdChuyen.Location = point;
            this.CmdChuyen.Name = "CmdChuyen";
            size = new Size(0x18, 0x17);
            this.CmdChuyen.Size = size;
            this.CmdChuyen.TabIndex = 14;
            this.CmdChuyen.Text = ">";
            this.CmdChuyen.UseVisualStyleBackColor = true;
            this.CmdChuyen.Visible = false;
            this.CboLoaiDuLieu.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiDuLieu.FormattingEnabled = true;
            point = new Point(90, 1);
            this.CboLoaiDuLieu.Location = point;
            this.CboLoaiDuLieu.Name = "CboLoaiDuLieu";
            size = new Size(0xa3, 0x15);
            this.CboLoaiDuLieu.Size = size;
            this.CboLoaiDuLieu.TabIndex = 13;
            this.CboLoaiDuLieu.Visible = false;
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage1);
            this.C1DockingTab1.Dock = DockStyle.Fill;
            point = new Point(0, 0xc4);
            this.C1DockingTab1.Location = point;
            this.C1DockingTab1.Name = "C1DockingTab1";
            size = new Size(0x37c, 0x155);
            this.C1DockingTab1.Size = size;
            this.C1DockingTab1.TabIndex = 0x11;
            this.C1DockingTab1.TabsSpacing = 5;
            this.C1DockingTab1.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab1.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab1.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage1.Controls.Add(this.VSHangHoa);
            this.C1DockingTabPage1.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage1.Location = point;
            this.C1DockingTabPage1.Name = "C1DockingTabPage1";
            size = new Size(890, 0x13b);
            this.C1DockingTabPage1.Size = size;
            this.C1DockingTabPage1.TabIndex = 0;
            this.C1DockingTabPage1.Text = "Chi tiết h\x00e0ng h\x00f3a";
            this.C1DockingTab2.Controls.Add(this.C1DockingTabPage2);
            this.C1DockingTab2.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.C1DockingTab2.Location = point;
            this.C1DockingTab2.Name = "C1DockingTab2";
            size = new Size(0x37c, 0xab);
            this.C1DockingTab2.Size = size;
            this.C1DockingTab2.TabIndex = 0;
            this.C1DockingTab2.TabsSpacing = 5;
            this.C1DockingTab2.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab2.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab2.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage2.Controls.Add(this.TxtNguoiNhan);
            this.C1DockingTabPage2.Controls.Add(this.CboLoaiNhapXuat);
            this.C1DockingTabPage2.Controls.Add(this.Label12);
            this.C1DockingTabPage2.Controls.Add(this.TxtSoChungTu);
            this.C1DockingTabPage2.Controls.Add(this.CboKhoanMucChiPhi);
            this.C1DockingTabPage2.Controls.Add(this.Label1);
            this.C1DockingTabPage2.Controls.Add(this.Label4);
            this.C1DockingTabPage2.Controls.Add(this.TxtNgayChungTu);
            this.C1DockingTabPage2.Controls.Add(this.Label13);
            this.C1DockingTabPage2.Controls.Add(this.Label3);
            this.C1DockingTabPage2.Controls.Add(this.Label10);
            this.C1DockingTabPage2.Controls.Add(this.AdvHopDong);
            this.C1DockingTabPage2.Controls.Add(this.Label11);
            this.C1DockingTabPage2.Controls.Add(this.AdvSanPham);
            this.C1DockingTabPage2.Controls.Add(this.txtTyGia);
            this.C1DockingTabPage2.Controls.Add(this.AdvBoPhan);
            this.C1DockingTabPage2.Controls.Add(this.CboLoaiTien);
            this.C1DockingTabPage2.Controls.Add(this.Label8);
            this.C1DockingTabPage2.Controls.Add(this.Label9);
            this.C1DockingTabPage2.Controls.Add(this.Label7);
            this.C1DockingTabPage2.Controls.Add(this.TxtDienGiai);
            this.C1DockingTabPage2.Controls.Add(this.Label6);
            this.C1DockingTabPage2.Controls.Add(this.AdvTaiKhoanChu);
            this.C1DockingTabPage2.Controls.Add(this.Label2);
            this.C1DockingTabPage2.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage2.Location = point;
            this.C1DockingTabPage2.Name = "C1DockingTabPage2";
            size = new Size(890, 0x91);
            this.C1DockingTabPage2.Size = size;
            this.C1DockingTabPage2.TabIndex = 0;
            this.C1DockingTabPage2.Text = "Th\x00f4ng tin phiếu xuất";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37c, 0x237);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.PNDungChung);
            this.Controls.Add(this.C1DockingTab1);
            this.Controls.Add(this.C1DockingTab2);
            this.Controls.Add(this.ToolStrip1);
            this.Controls.Add(this.Panel4);
            this.FormBorderStyle = FormBorderStyle.FixedSingle;
            this.KeyPreview = true;
            this.Name = "Frm_XuatKho";
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "ST-0001";
            this.Text = "PHIEU XUAT KHO";
            ((ISupportInitialize) this.txtTyGia).EndInit();
            this.Panel4.ResumeLayout(false);
            this.Panel4.PerformLayout();
            ((ISupportInitialize) this.TxtSoLuong).EndInit();
            this.Panel5.ResumeLayout(false);
            this.Panel5.PerformLayout();
            ((ISupportInitialize) this.TxtTienHangNT).EndInit();
            ((ISupportInitialize) this.TxtTienHang).EndInit();
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.VSHangHoa.EndInit();
            this.PNDungChung.ResumeLayout(false);
            ((ISupportInitialize) this.C1DockingTab1).EndInit();
            this.C1DockingTab1.ResumeLayout(false);
            this.C1DockingTabPage1.ResumeLayout(false);
            ((ISupportInitialize) this.C1DockingTab2).EndInit();
            this.C1DockingTab2.ResumeLayout(false);
            this.C1DockingTabPage2.ResumeLayout(false);
            this.C1DockingTabPage2.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void LoadDetailsHangHoa(string pKhoa)
        {
            DataTable listDetails = this.objXK.GetListDetails(pKhoa);
            if (listDetails != null)
            {
                this.VSHangHoa.Rows.Count = 1;
                int num2 = listDetails.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                    vSHangHoa.AddItem("");
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Khoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaKho"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoHang"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Ma"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["HangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoLoHang"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoSeri"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["NgayNhap"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 9] = LVYModule.Char2Date(Conversions.ToString(listDetails.Rows[i]["HanSuDung"]));
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaDonViTinh"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["DonViTinh"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["QuyCach"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoLuong"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["GiaVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = 0;
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = 0;
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaTKHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x13] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TaiKhoanHangHoa"]);
                    vSHangHoa = null;
                }
            }
        }

        public bool SaveHHDetailsTemp()
        {
            double num2 = 0.0;
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            clsXuatKhoChiTiet objXKHH = this.objXKHH;
            int num3 = this.VSHangHoa.Rows.Count - 1;
            for (int i = 1; i <= num3; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        this.VSHangHoa[i, 0] = modGeneral.CreatKey("ST_XuatKhoChiTiet", 15, "");
                    }
                    objXKHH.Khoa = this.VSHangHoa[i, 0].ToString().Trim();
                    objXKHH.NamThang = LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6);
                    objXKHH.KhoaPhieuXuat = this.cFrmKhoa;
                    objXKHH.NgayBan = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
                    objXKHH.KhoaHangHoa = this.VSHangHoa[i, 3].ToString().Trim();
                    objXKHH.KhoaKho = this.VSHangHoa[i, 1].ToString().Trim();
                    objXKHH.KhoaQuayKe = "";
                    objXKHH.SoLoHang = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 6]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objXKHH.NgayNhap = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 8]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objXKHH.HanSuDung = LVYModule.Date2Char(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 9]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    objXKHH.SoSeri = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 7]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objXKHH.SoLuong = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 13]), 0, modGeneral.TypeOfValue.Nothing));
                    objXKHH.GiaVonNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 14]), 0, modGeneral.TypeOfValue.Nothing)) / num2;
                    objXKHH.GiaVon = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 14]), 0, modGeneral.TypeOfValue.Nothing));
                    objXKHH.TienVonNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 15]), 0, modGeneral.TypeOfValue.Nothing)) / num2;
                    objXKHH.TienVon = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                    objXKHH.KhoaDonViTinh = this.VSHangHoa[i, 10].ToString().Trim();
                    objXKHH.QuyCach = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                    objXKHH.KhoaTKHangHoa = this.VSHangHoa[i, 0x12].ToString().Trim();
                    if (!objXKHH.Save())
                    {
                        return false;
                    }
                }
            }
            objXKHH = null;
            return true;
        }

        public void ShowData(string pKhoa)
        {
            if (this.objXK.Load(pKhoa))
            {
                clsXuatKho objXK = this.objXK;
                this.cFrmKhoa = objXK.Khoa;
                this.TxtSoChungTu.Text = objXK.SoChungTu;
                this.TxtNgayChungTu.Text = LVYModule.Char2Date(objXK.NgayChungTu);
                this.CboLoaiTien.SelectedValue = objXK.LoaiTien;
                this.txtTyGia.Value = objXK.TyGia;
                this.TxtTienHangNT.Value = objXK.TienVonNT;
                this.TxtTienHang.Value = objXK.TienVon;
                this.TxtNguoiNhan.Text = objXK.NguoiGiao;
                this.AdvTaiKhoanChu.Value = objXK.KhoaTKThanhToan;
                this.TxtDienGiai.Text = objXK.DienGiai;
                this.cFrmGhiSo = objXK.GhiSo;
                this.CboLoaiDuLieu.SelectedValue = objXK.DuLieu;
                this.CboKhoanMucChiPhi.SelectedValue = LVYModule.ReturnIfNull(objXK.KhoaKhoanMuc, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                this.CboLoaiNhapXuat.SelectedValue = LVYModule.ReturnIfNull(objXK.KhoaLoaiXuat, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                this.CboLoaiDuLieu.SelectedValue = objXK.DuLieu;
                this.LoadDetailsHangHoa(this.cFrmKhoa);
                objXK = null;
            }
        }

        public void TinhTienVon(int nRow)
        {
            double num = 0.0;
            double num3 = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 14]), 0, modGeneral.TypeOfValue.Nothing));
            num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 12]), 1, modGeneral.TypeOfValue.Nothing));
            vSHangHoa[nRow, 15] = (num * num3) * num2;
            vSHangHoa = null;
        }

        public void TinhTong()
        {
            double num = 0.0;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtTienHangNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 15);
            this.TxtTienHang.Value = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) * num;
        }

        public object UpdateData()
        {
            object obj2;
            clsXuatKho objXK = this.objXK;
            objXK.Khoa = this.cFrmKhoa;
            objXK.KhoaLoaiXuat = Conversions.ToString(this.CboLoaiNhapXuat.SelectedValue);
            objXK.KhoaKhoanMuc = Conversions.ToString(this.CboKhoanMucChiPhi.SelectedValue);
            objXK.SoChungTu = this.TxtSoChungTu.Text.Trim();
            objXK.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objXK.NguoiGiao = "";
            objXK.KhoaBoPhan = this.AdvBoPhan.Value;
            objXK.KhoaSanPham = this.AdvSanPham.Value;
            objXK.KhoaHopDong = this.AdvHopDong.Value;
            objXK.LoaiTien = this.CboLoaiTien.SelectedValue.ToString().Trim();
            objXK.TyGia = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.txtTyGia.Value), 1, modGeneral.TypeOfValue.Nothing));
            objXK.TienVonNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objXK.TienVon = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHang.Value), 0, modGeneral.TypeOfValue.Nothing));
            objXK.KhoaTKThanhToan = LVYModule.ReturnIfNull(this.AdvTaiKhoanChu.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objXK.DienGiai = this.TxtDienGiai.Text.ToString().Trim();
            objXK.DaThanhToanNT = 0.0;
            objXK.DaThanhToan = 0.0;
            objXK.LoaiChungTu = "XK";
            objXK.NguoiGiao = this.TxtNguoiNhan.Text;
            if (objXK.KhoaNhanVienTao.Trim() == "")
            {
                objXK.KhoaNhanVienTao = modGeneral.H_USERID;
            }
            if (objXK.NgayTao.Trim() == "")
            {
                objXK.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            }
            objXK.KhoaNhanVienSua = modGeneral.H_USERID;
            objXK.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objXK.GhiSo = 1;
            objXK.KhoaDonVi = modGeneral.H_CLIENT;
            objXK.Send = 0;
            objXK.DuLieu = Conversions.ToString(this.CboLoaiDuLieu.SelectedValue);
            return objXK.Save();
            objXK = null;
            return obj2;
        }

        private void VSHangHoa_AfterEdit(object sender, RowColEventArgs e)
        {
            switch (e.Col)
            {
                case 11:
                case 12:
                    this.TinhTienVon(e.Row);
                    break;

                case 13:
                    this.TinhTienVon(e.Row);
                    break;
            }
            this.TinhTong();
        }

        private void VSHangHoa_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if ((((((e.Col == 5) | (e.Col == 7)) | (e.Col == 12)) | (e.Col == 14)) | (e.Col == 0x10)) | (e.Col == 0x11))
            {
                e.Cancel = true;
            }
        }

        private void VSHangHoa_CausesValidationChanged(object sender, EventArgs e)
        {
        }

        private void VSHangHoa_CellButtonClick(object sender, RowColEventArgs e)
        {
            object obj2;
            switch (e.Col)
            {
                case 2:
                {
                    string expression = SearchModule.SearchStore("");
                    if (expression.Trim() != "")
                    {
                        obj2 = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                        this.VSHangHoa[e.Row, 1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null));
                        this.VSHangHoa[e.Row, 2] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null));
                    }
                    this.VSHangHoa.Select(e.Row, 4);
                    break;
                }
                case 4:
                    obj2 = SearchModule.SearchGoodsInStock(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), "", true);
                    if (obj2 != null)
                    {
                        if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null)), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
                        {
                            this.objHH.Load(Conversions.ToString(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null)));
                            this.pdt = this.objHH.GetHangHoa(Conversions.ToString(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null)));
                            this.objDVT.Load(this.objHH.KhoaDonViTinh);
                            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                            vSHangHoa[e.Row, 3] = this.objHH.Khoa;
                            vSHangHoa[e.Row, 4] = this.objHH.Ma;
                            if (modGeneral.H_LANGUAGE == "VIET")
                            {
                                vSHangHoa[e.Row, 5] = this.objHH.TenViet;
                                vSHangHoa[e.Row, 11] = this.objDVT.TenViet;
                            }
                            else
                            {
                                vSHangHoa[e.Row, 5] = this.objHH.TenAnh;
                                vSHangHoa[e.Row, 11] = this.objDVT.TenAnh;
                            }
                            vSHangHoa[e.Row, 6] = NewLateBinding.LateIndexGet(obj2, new object[] { 2 }, null).ToString().Trim();
                            vSHangHoa[e.Row, 9] = LVYModule.Char2Date(NewLateBinding.LateIndexGet(obj2, new object[] { 4 }, null).ToString().Trim());
                            vSHangHoa[e.Row, 7] = "";
                            vSHangHoa[e.Row, 8] = NewLateBinding.LateIndexGet(obj2, new object[] { 3 }, null).ToString().Trim();
                            vSHangHoa[e.Row, 10] = this.objHH.KhoaDonViTinh;
                            vSHangHoa[e.Row, 12] = 1;
                            vSHangHoa[e.Row, 13] = 1;
                            vSHangHoa[e.Row, 14] = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 7 }, null)), 0, modGeneral.TypeOfValue.Nothing));
                            vSHangHoa[e.Row, 15] = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 7 }, null)), 0, modGeneral.TypeOfValue.Nothing));
                            vSHangHoa[e.Row, 0x10] = 0;
                            vSHangHoa[e.Row, 0x11] = 0;
                            vSHangHoa[e.Row, 0x12] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["KhoaTKHangHoa"]);
                            vSHangHoa[e.Row, 0x13] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["TaiKhoanHangHoa"]);
                            vSHangHoa.Select(e.Row, 13);
                            vSHangHoa = null;
                        }
                        break;
                    }
                    break;

                case 11:
                {
                    C1.Win.C1FlexGrid.C1FlexGrid grid2 = this.VSHangHoa;
                    obj2 = SearchModule.SearchDVT(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(grid2[e.Row, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), this.VSHangHoa, e.Row, e.Col, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(grid2[e.Row, 10]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (obj2 != null)
                    {
                        if (Information.UBound((Array) obj2, 1) >= 2)
                        {
                            grid2[e.Row, 10] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null));
                            grid2[e.Row, 11] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null));
                            grid2[e.Row, 12] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 2 }, null));
                            this.VSHangHoa_AfterEdit(RuntimeHelpers.GetObjectValue(sender), e);
                        }
                        grid2.Select(e.Row, 13);
                        grid2 = null;
                        break;
                    }
                    break;
                }
            }
        }

        internal virtual ADVList AdvBoPhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvBoPhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvBoPhan = value;
            }
        }

        internal virtual ADVList AdvHopDong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvHopDong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvHopDong = value;
            }
        }

        internal virtual ADVList AdvSanPham
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvSanPham;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvSanPham = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanChu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanChu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanChu = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual ComboBox CboKhoanMucChiPhi
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboKhoanMucChiPhi;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboKhoanMucChiPhi = value;
            }
        }

        internal virtual ComboBox CboLoaiDuLieu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiDuLieu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiDuLieu = value;
            }
        }

        internal virtual ComboBox CboLoaiNhapXuat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiNhapXuat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiNhapXuat = value;
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKHienThiSeri
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKHienThiSeri;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKHienThiSeri_CheckedChanged);
                if (this._CKHienThiSeri != null)
                {
                    this._CKHienThiSeri.CheckedChanged -= handler;
                }
                this._CKHienThiSeri = value;
                if (this._CKHienThiSeri != null)
                {
                    this._CKHienThiSeri.CheckedChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKSoSeri
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKSoSeri;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKSoSeri = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdBoGhiSo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdBoGhiSo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdBoGhiSo_Click);
                if (this._CmdBoGhiSo != null)
                {
                    this._CmdBoGhiSo.Click -= handler;
                }
                this._CmdBoGhiSo = value;
                if (this._CmdBoGhiSo != null)
                {
                    this._CmdBoGhiSo.Click += handler;
                }
            }
        }

        internal virtual Button CmdChuyen
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdChuyen;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdChuyen = value;
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDelRow_Click);
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click -= handler;
                }
                this._CmdDelRow = value;
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdGhiSo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdGhiSo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdGhiSo_Click);
                if (this._CmdGhiSo != null)
                {
                    this._CmdGhiSo.Click -= handler;
                }
                this._CmdGhiSo = value;
                if (this._CmdGhiSo != null)
                {
                    this._CmdGhiSo.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button CmdSearchHangHoa
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSearchHangHoa;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdSearchHangHoa = value;
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdAddRow.Enabled = value;
                this.CmdDelRow.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.txtTyGia.ReadOnly = !value;
                this.TxtDienGiai.ReadOnly = !value;
                this.AdvTaiKhoanChu.ReadOnly = !value;
                this.TxtBarCode.ReadOnly = !value;
                this.CmdSearchHangHoa.Enabled = value;
                this.CboKhoanMucChiPhi.Enabled = value;
                this.CboLoaiNhapXuat.Enabled = value;
                this.AdvBoPhan.Enabled = value;
                this.AdvSanPham.Enabled = value;
                this.AdvHopDong.Enabled = value;
                this.CmdGhiSo.Enabled = !value;
                this.CmdBoGhiSo.Enabled = !value;
                this.TxtNguoiNhan.Enabled = value;
                this.CboLoaiDuLieu.Enabled = value;
                this.CmdChuyen.Enabled = !value;
            }
        }

        internal virtual ImageList ImageList1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ImageList1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ImageList1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label10
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label10;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label10 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label12
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label12;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label12 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label25
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label25;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label25 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label8
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label8;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label8 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual Panel PNDungChung
        {
            [DebuggerNonUserCode]
            get
            {
                return this._PNDungChung;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._PNDungChung = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripButton ToolStripButton2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual TextBox TxtBarCode
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtBarCode;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtBarCode = value;
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayChungTu = value;
            }
        }

        internal virtual TextBox TxtNguoiNhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNguoiNhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNguoiNhan = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual C1NumericEdit TxtSoLuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoLuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoLuong = value;
            }
        }

        internal virtual C1NumericEdit TxtTienHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHang = value;
            }
        }

        internal virtual C1NumericEdit TxtTienHangNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHangNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHangNT = value;
            }
        }

        internal virtual C1NumericEdit txtTyGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._txtTyGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._txtTyGia = value;
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSHangHoa
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSHangHoa;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.VSHangHoa_CausesValidationChanged);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSHangHoa_CellButtonClick);
                RowColEventHandler handler3 = new RowColEventHandler(this.VSHangHoa_BeforeEdit);
                RowColEventHandler handler4 = new RowColEventHandler(this.VSHangHoa_AfterEdit);
                if (this._VSHangHoa != null)
                {
                    this._VSHangHoa.CausesValidationChanged -= handler;
                    this._VSHangHoa.CellButtonClick -= handler2;
                    this._VSHangHoa.BeforeEdit -= handler3;
                    this._VSHangHoa.AfterEdit -= handler4;
                }
                this._VSHangHoa = value;
                if (this._VSHangHoa != null)
                {
                    this._VSHangHoa.CausesValidationChanged += handler;
                    this._VSHangHoa.CellButtonClick += handler2;
                    this._VSHangHoa.BeforeEdit += handler3;
                    this._VSHangHoa.AfterEdit += handler4;
                }
            }
        }
    }
}

